import 'package:my_flutter_demo/exports.dart';

class ImageDemoPage extends StatelessWidget {
  const ImageDemoPage({Key?key}):super(key:key);
  @override
  Widget build(BuildContext context) {

    return Scaffold(
      appBar: AppBar(
        title: Text('Image'),
      ),
      body:
      Center(
        child:
        Column(
          children: [
            Image.asset('assets/images/image1.jpg',
              width: 200,
              height: 100,
              fit: BoxFit.cover,// 保持比例，填满容器，可能裁剪
            ),
            SizedBox(
              height: 20,
            ),
            Image.asset('assets/images/image1.jpg',
              width: 200,
              height: 100,
              fit: BoxFit.contain,// 保持比例，完整显示
            ),
            SizedBox(
              height: 20,
            ),
            Image.network('https://photocq.photo.store.qq.com/psc?/a5884b44-9c25-4d7b-bea1-0db6db7e87b6/PBfbIKZtAJlvfOqE04IdJVgAlMptaxnw0b.WlvepEKpCaeHbafj1jgw3cDuE35R3Nx9GUE6**PLL2dHTjJwJeA!!/b&bo=kAQgAwAAAAARB4c!&rf=viewer_4',
              width: 200,
              height: 100,
              fit: BoxFit.fill,
              // cacheHeight: 50,
              // cacheWidth: 50,
            ),

          ],
        ),
      )

    );
  }
}
